
 /**
 * RolePermission.java.java.
 * User: BrianChen Date: 2012-6-7 下午10:29:53
 *
 * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
 * All rights reserved.
 */
package com.collapsar.core.security.model;

import java.security.Permission;

/**
 * <pre>
 * REVISIONS: 
 * Version 	Date 		Author 			Description
 * ------------------------------------------------------------------- 
 * 1.0 		2012-6-7 	BrianChen 	1. Created this class. 
 * </pre>
 * 
 * @author BrianChen
 * @date 2012-6-7 下午10:29:53
 * @version 1.0
 * @see
 * 
 */
@SuppressWarnings("serial")
public class RolePermission extends Permission{
	public RolePermission(String name) {
		super(name); // TODO Auto-generated constructor stub
	}

	private Role role = null;
	
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Override
	public boolean implies(Permission permission) {
		// TODO Auto-generated method stub return false;
		return false;
	}

	@Override
	public boolean equals(Object obj) {
		if(this == obj){
			return true;
		}
		if(!(obj instanceof RolePermission)){
			return false;
		}
		final RolePermission permission = (RolePermission)obj;
		if(!this.role.equals(permission.getRole())){
			return false;
		}
		return true;
	}

	@Override
	public int hashCode() {
		return this.role.hashCode();
	}

	@Override
	public String getActions() {
		// TODO Auto-generated method stub return null;
		return null;
	}

}

